home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / SAMPLES / VISDATA / DCPROP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-10-16  |  18.1 KB  |  574 lines

  1. VERSION 5.00
  2. Begin VB.Form frmDataCtlProp 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Data Control Properties"
  5.    ClientHeight    =   5280
  6.    ClientLeft      =   1740
  7.    ClientTop       =   1695
  8.    ClientWidth     =   5910
  9.    BeginProperty Font 
  10.       Name            =   "Tahoma"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   5745
  19.    HelpContextID   =   2016124
  20.    Icon            =   "DCPROP.frx":0000
  21.    Left            =   1680
  22.    LinkTopic       =   "Form1"
  23.    LockControls    =   -1  'True
  24.    MaxButton       =   0   'False
  25.    MinButton       =   0   'False
  26.    ScaleHeight     =   5280
  27.    ScaleWidth      =   5910
  28.    ShowInTaskbar   =   0   'False
  29.    StartUpPosition =   1  'CenterOwner
  30.    Top             =   1290
  31.    Width           =   6030
  32.    Begin VB.PictureBox picCtlType 
  33.       Appearance      =   0  'Flat
  34.       BorderStyle     =   0  'None
  35.       ForeColor       =   &H80000008&
  36.       Height          =   255
  37.       Left            =   2760
  38.       ScaleHeight     =   255
  39.       ScaleWidth      =   2775
  40.       TabIndex        =   38
  41.       Top             =   4440
  42.       Width           =   2775
  43.       Begin VB.OptionButton optOLECtl 
  44.          Caption         =   "OLE"
  45.          Height          =   255
  46.          Left            =   0
  47.          MaskColor       =   &H00000000&
  48.          TabIndex        =   40
  49.          Top             =   0
  50.          Width           =   735
  51.       End
  52.       Begin VB.OptionButton optPictureCtl 
  53.          Caption         =   "PictureBox"
  54.          Height          =   255
  55.          Left            =   1080
  56.          MaskColor       =   &H00000000&
  57.          TabIndex        =   39
  58.          Top             =   0
  59.          Width           =   1215
  60.       End
  61.    End
  62.    Begin VB.CheckBox chkForwardOnly 
  63.       Caption         =   "ForwardOnly"
  64.       Height          =   255
  65.       Left            =   2040
  66.       MaskColor       =   &H00000000&
  67.       TabIndex        =   16
  68.       Top             =   3000
  69.       Width           =   1590
  70.    End
  71.    Begin VB.CheckBox chkFailOnError 
  72.       Caption         =   "FailOnError"
  73.       Height          =   255
  74.       Left            =   840
  75.       MaskColor       =   &H00000000&
  76.       TabIndex        =   15
  77.       Top             =   3000
  78.       Width           =   1215
  79.    End
  80.    Begin VB.CheckBox chkSQLPassthrough 
  81.       Caption         =   "SQLPassthru"
  82.       Height          =   255
  83.       Left            =   3240
  84.       MaskColor       =   &H00000000&
  85.       TabIndex        =   14
  86.       Top             =   2760
  87.       Width           =   1335
  88.    End
  89.    Begin VB.CheckBox chkConsistent 
  90.       Caption         =   "Consistent"
  91.       Height          =   255
  92.       Left            =   2040
  93.       MaskColor       =   &H00000000&
  94.       TabIndex        =   13
  95.       Top             =   2760
  96.       Width           =   1095
  97.    End
  98.    Begin VB.CheckBox chkInconsistent 
  99.       Caption         =   "Inconsistent"
  100.       Height          =   255
  101.       Left            =   840
  102.       MaskColor       =   &H00000000&
  103.       TabIndex        =   12
  104.       Top             =   2760
  105.       Width           =   1215
  106.    End
  107.    Begin VB.CheckBox chkAppendOnly 
  108.       Caption         =   "AppendOnly"
  109.       Height          =   255
  110.       Left            =   4440
  111.       MaskColor       =   &H00000000&
  112.       TabIndex        =   11
  113.       Top             =   2520
  114.       Width           =   1215
  115.    End
  116.    Begin VB.CheckBox chkReadOnly 
  117.       Caption         =   "ReadOnly"
  118.       Height          =   255
  119.       Left            =   3240
  120.       MaskColor       =   &H00000000&
  121.       TabIndex        =   10
  122.       Top             =   2520
  123.       Width           =   1095
  124.    End
  125.    Begin VB.CheckBox chkDenyRead 
  126.       Caption         =   "DenyRead"
  127.       Height          =   255
  128.       Left            =   2040
  129.       MaskColor       =   &H00000000&
  130.       TabIndex        =   9
  131.       Top             =   2520
  132.       Width           =   1095
  133.    End
  134.    Begin VB.CheckBox chkDenyWrite 
  135.       Caption         =   "DenyWrite"
  136.       Height          =   255
  137.       Left            =   840
  138.       MaskColor       =   &H00000000&
  139.       TabIndex        =   8
  140.       Top             =   2520
  141.       Width           =   1095
  142.    End
  143.    Begin VB.CheckBox chkDBReadOnly 
  144.       Caption         =   "ReadOnly"
  145.       Height          =   255
  146.       Left            =   3000
  147.       MaskColor       =   &H00000000&
  148.       TabIndex        =   3
  149.       Top             =   1080
  150.       Width           =   1215
  151.    End
  152.    Begin VB.CheckBox chkExclusive 
  153.       Caption         =   "Exclusive"
  154.       Height          =   255
  155.       Left            =   1080
  156.       MaskColor       =   &H00000000&
  157.       TabIndex        =   2
  158.       Top             =   1080
  159.       Width           =   1335
  160.    End
  161.    Begin VB.CommandButton cmdCancel 
  162.       Cancel          =   -1  'True
  163.       Caption         =   "&Cancel"
  164.       Height          =   375
  165.       Left            =   3120
  166.       MaskColor       =   &H00000000&
  167.       TabIndex        =   23
  168.       Top             =   4800
  169.       Width           =   2295
  170.    End
  171.    Begin VB.CommandButton cmdRefresh 
  172.       Caption         =   "&Refresh Data Control"
  173.       Height          =   375
  174.       Left            =   360
  175.       MaskColor       =   &H00000000&
  176.       TabIndex        =   22
  177.       Top             =   4800
  178.       Width           =   2295
  179.    End
  180.    Begin VB.TextBox txtRecordSource 
  181.       Height          =   285
  182.       Left            =   1320
  183.       TabIndex        =   4
  184.       Top             =   1800
  185.       Width           =   4455
  186.    End
  187.    Begin VB.TextBox txtConnect 
  188.       Height          =   285
  189.       Left            =   840
  190.       TabIndex        =   1
  191.       Top             =   720
  192.       Width           =   4935
  193.    End
  194.    Begin VB.TextBox txtDatabaseName 
  195.       Height          =   285
  196.       Left            =   840
  197.       TabIndex        =   0
  198.       Top             =   360
  199.       Width           =   4935
  200.    End
  201.    Begin VB.PictureBox picRSType 
  202.       Appearance      =   0  'Flat
  203.       BorderStyle     =   0  'None
  204.       ForeColor       =   &H80000008&
  205.       Height          =   285
  206.       Left            =   1680
  207.       ScaleHeight     =   285
  208.       ScaleWidth      =   4095
  209.       TabIndex        =   29
  210.       TabStop         =   0   'False
  211.       Top             =   2160
  212.       Width           =   4095
  213.       Begin VB.OptionButton optRSType 
  214.          Caption         =   "1 - Dynaset"
  215.          Height          =   255
  216.          Index           =   1
  217.          Left            =   1200
  218.          MaskColor       =   &H00000000&
  219.          TabIndex        =   6
  220.          Top             =   5
  221.          Width           =   1335
  222.       End
  223.       Begin VB.OptionButton optRSType 
  224.          Caption         =   "0 - Table"
  225.          Height          =   255
  226.          Index           =   0
  227.          Left            =   20
  228.          MaskColor       =   &H00000000&
  229.          TabIndex        =   5
  230.          Top             =   5
  231.          Width           =   1215
  232.       End
  233.       Begin VB.OptionButton optRSType 
  234.          Caption         =   "2 - Snapshot"
  235.          Height          =   255
  236.          Index           =   2
  237.          Left            =   2640
  238.          MaskColor       =   &H00000000&
  239.          TabIndex        =   7
  240.          Top             =   5
  241.          Width           =   1455
  242.       End
  243.    End
  244.    Begin VB.PictureBox picEOFAction 
  245.       Appearance      =   0  'Flat
  246.       BorderStyle     =   0  'None
  247.       ForeColor       =   &H80000008&
  248.       Height          =   255
  249.       Left            =   1320
  250.       ScaleHeight     =   255
  251.       ScaleWidth      =   3855
  252.       TabIndex        =   27
  253.       TabStop         =   0   'False
  254.       Top             =   4080
  255.       Width           =   3855
  256.       Begin VB.OptionButton optEOFAction 
  257.          Caption         =   "2 - AddNew"
  258.          Height          =   255
  259.          Index           =   2
  260.          Left            =   2520
  261.          MaskColor       =   &H00000000&
  262.          TabIndex        =   21
  263.          Top             =   0
  264.          Width           =   1215
  265.       End
  266.       Begin VB.OptionButton optEOFAction 
  267.          Caption         =   "0 - MoveLast"
  268.          Height          =   255
  269.          Index           =   0
  270.          Left            =   0
  271.          MaskColor       =   &H00000000&
  272.          TabIndex        =   19
  273.          Top             =   0
  274.          Width           =   1335
  275.       End
  276.       Begin VB.OptionButton optEOFAction 
  277.          Caption         =   "1 - EOF"
  278.          Height          =   255
  279.          Index           =   1
  280.          Left            =   1440
  281.          MaskColor       =   &H00000000&
  282.          TabIndex        =   20
  283.          Top             =   0
  284.          Width           =   975
  285.       End
  286.    End
  287.    Begin VB.PictureBox picBOFAction 
  288.       Appearance      =   0  'Flat
  289.       BorderStyle     =   0  'None
  290.       ForeColor       =   &H80000008&
  291.       Height          =   255
  292.       Left            =   1320
  293.       ScaleHeight     =   255
  294.       ScaleWidth      =   2535
  295.       TabIndex        =   25
  296.       TabStop         =   0   'False
  297.       Top             =   3720
  298.       Width           =   2535
  299.       Begin VB.OptionButton optBOFAction 
  300.          Caption         =   "1 - BOF"
  301.          Height          =   255
  302.          Index           =   1
  303.          Left            =   1440
  304.          MaskColor       =   &H00000000&
  305.          TabIndex        =   18
  306.          Top             =   0
  307.          Width           =   975
  308.       End
  309.       Begin VB.OptionButton optBOFAction 
  310.          Caption         =   "0 - MoveFirst"
  311.          Height          =   255
  312.          Index           =   0
  313.          Left            =   0
  314.          MaskColor       =   &H00000000&
  315.          TabIndex        =   17
  316.          Top             =   0
  317.          Width           =   1335
  318.       End
  319.    End
  320.    Begin VB.Label lblLabels 
  321.       Caption         =   "Bound Binary Control Type: "
  322.       Height          =   195
  323.       Index           =   9
  324.       Left            =   120
  325.       TabIndex        =   37
  326.       Top             =   4440
  327.       Width           =   2535
  328.    End
  329.    Begin VB.Label lblLabels 
  330.       Alignment       =   2  'Center
  331.       Caption         =   "Data Control Properties"
  332.       Height          =   195
  333.       Index           =   8
  334.       Left            =   120
  335.       TabIndex        =   36
  336.       Top             =   3480
  337.       Width           =   5655
  338.    End
  339.    Begin VB.Line Line1 
  340.       BorderWidth     =   3
  341.       Index           =   1
  342.       X1              =   120
  343.       X2              =   5760
  344.       Y1              =   3360
  345.       Y2              =   3360
  346.    End
  347.    Begin VB.Line Line1 
  348.       BorderWidth     =   3
  349.       Index           =   0
  350.       X1              =   120
  351.       X2              =   5760
  352.       Y1              =   1440
  353.       Y2              =   1440
  354.    End
  355.    Begin VB.Label lblLabels 
  356.       Alignment       =   2  'Center
  357.       Caption         =   "Recordset Properties"
  358.       Height          =   195
  359.       Index           =   10
  360.       Left            =   120
  361.       TabIndex        =   35
  362.       Top             =   1560
  363.       Width           =   5655
  364.    End
  365.    Begin VB.Label lblLabels 
  366.       Alignment       =   2  'Center
  367.       Caption         =   "Database Properties"
  368.       Height          =   195
  369.       Index           =   7
  370.       Left            =   120
  371.       TabIndex        =   34
  372.       Top             =   45
  373.       Width           =   5655
  374.    End
  375.    Begin VB.Label lblLabels 
  376.       AutoSize        =   -1  'True
  377.       Caption         =   "Options: "
  378.       Height          =   195
  379.       Index           =   6
  380.       Left            =   120
  381.       TabIndex        =   33
  382.       Top             =   2520
  383.       Width           =   660
  384.    End
  385.    Begin VB.Label lblLabels 
  386.       AutoSize        =   -1  'True
  387.       Caption         =   "RecordSource: "
  388.       Height          =   195
  389.       Index           =   5
  390.       Left            =   120
  391.       TabIndex        =   32
  392.       Top             =   1800
  393.       Width           =   1110
  394.    End
  395.    Begin VB.Label lblLabels 
  396.       AutoSize        =   -1  'True
  397.       Caption         =   "Connect: "
  398.       Height          =   195
  399.       Index           =   4
  400.       Left            =   120
  401.       TabIndex        =   31
  402.       Top             =   720
  403.       Width           =   705
  404.    End
  405.    Begin VB.Label lblLabels 
  406.       AutoSize        =   -1  'True
  407.       Caption         =   "Name: "
  408.       Height          =   195
  409.       Index           =   3
  410.       Left            =   120
  411.       TabIndex        =   30
  412.       Top             =   360
  413.       Width           =   510
  414.    End
  415.    Begin VB.Label lblLabels 
  416.       AutoSize        =   -1  'True
  417.       Caption         =   "RecordsetType: "
  418.       Height          =   195
  419.       Index           =   2
  420.       Left            =   120
  421.       TabIndex        =   28
  422.       Top             =   2160
  423.       Width           =   1200
  424.    End
  425.    Begin VB.Label lblLabels 
  426.       Caption         =   "EOFAction: "
  427.       Height          =   195
  428.       Index           =   1
  429.       Left            =   120
  430.       TabIndex        =   26
  431.       Top             =   4080
  432.       Width           =   1215
  433.    End
  434.    Begin VB.Label lblLabels 
  435.       Caption         =   "BOFAction: "
  436.       Height          =   195
  437.       Index           =   0
  438.       Left            =   120
  439.       TabIndex        =   24
  440.       Top             =   3720
  441.       Width           =   1095
  442.    End
  443. Attribute VB_Name = "frmDataCtlProp"
  444. Attribute VB_Base = "0{529A446B-C9E1-11CF-9ED2-00AA00574745}"
  445. Attribute VB_GlobalNameSpace = False
  446. Attribute VB_Creatable = False
  447. Attribute VB_TemplateDerived = False
  448. Attribute VB_PredeclaredId = True
  449. Attribute VB_Exposed = False
  450. Attribute VB_Customizable = False
  451. Option Explicit
  452. '>>>>>>>>>>>>>>>>>>>>>>>>
  453. Const FORMCAPTION = "Data Control Properties"
  454. Const BUTTON1 = "&Refresh Data Control"
  455. Const BUTTON2 = "&Cancel"
  456. Const Label1 = "Database Properties"
  457. Const Label2 = "Recordset Properties"
  458. Const LABEL3 = "Data Control Properties"
  459. Const LABEL4 = "Bound Binary Control Type:"
  460. '>>>>>>>>>>>>>>>>>>>>>>>>
  461. Sub cmdCancel_Click()
  462.   Set gDataCtlObj = Nothing
  463.   Unload Me
  464. End Sub
  465. Sub cmdRefresh_Click()
  466.   On Error GoTo RefErr
  467.   gbSettingDataCtl = True
  468.   gDataCtlObj.DatabaseName = txtDatabaseName.Text
  469.   gDataCtlObj.Connect = txtConnect.Text
  470.   gDataCtlObj.Exclusive = IIf(chkExclusive.Value = vbUnchecked, 0, -1)
  471.   gDataCtlObj.ReadOnly = IIf(chkDBReadOnly.Value = vbUnchecked, 0, -1)
  472.   gDataCtlObj.RecordSource = txtRecordSource.Text
  473.   If optRSType(0).Value Then
  474.     gDataCtlObj.RecordsetType = 0
  475.   ElseIf optRSType(1).Value Then
  476.     gDataCtlObj.RecordsetType = 1
  477.   Else
  478.     gDataCtlObj.RecordsetType = 2
  479.   End If
  480.   gDataCtlObj.Options = 0
  481.   'set the selected options
  482.   If chkDenyWrite.Value = vbChecked Then
  483.     gDataCtlObj.Options = gDataCtlObj.Options Or dbDenyWrite
  484.   End If
  485.   If chkDenyRead.Value = vbChecked Then
  486.     gDataCtlObj.Options = gDataCtlObj.Options Or dbDenyRead
  487.   End If
  488.   If chkReadOnly.Value = vbChecked Then
  489.     gDataCtlObj.Options = gDataCtlObj.Options Or dbReadOnly
  490.   End If
  491.   If chkAppendOnly.Value = vbChecked Then
  492.     gDataCtlObj.Options = gDataCtlObj.Options Or dbAppendOnly
  493.   End If
  494.   If chkInconsistent.Value = vbChecked Then
  495.     gDataCtlObj.Options = gDataCtlObj.Options Or dbInconsistent
  496.   End If
  497.   If chkConsistent.Value = vbChecked Then
  498.     gDataCtlObj.Options = gDataCtlObj.Options Or dbConsistent
  499.   End If
  500.   If chkSQLPassthrough.Value = vbChecked Then
  501.     gDataCtlObj.Options = gDataCtlObj.Options Or dbSQLPassThrough
  502.   End If
  503.   If chkFailOnError.Value = vbChecked Then
  504.     gDataCtlObj.Options = gDataCtlObj.Options Or dbFailOnError
  505.   End If
  506.   If chkForwardOnly.Value = vbChecked Then
  507.     gDataCtlObj.Options = gDataCtlObj.Options Or dbForwardOnly
  508.   End If
  509.   If optBOFAction(0).Value Then
  510.     gDataCtlObj.BOFAction = 0
  511.   Else
  512.     gDataCtlObj.BOFAction = 1
  513.   End If
  514.   If optEOFAction(0).Value Then
  515.     gDataCtlObj.EOFAction = 0
  516.   ElseIf optEOFAction(1).Value Then
  517.     gDataCtlObj.EOFAction = 1
  518.   Else
  519.     gDataCtlObj.EOFAction = 2
  520.   End If
  521.   gDataCtlObj.Tag = IIf(optOLECtl.Value, "OLE", "PIC")
  522.   Unload Me
  523.   Exit Sub
  524. RefErr:
  525.   gbSettingDataCtl = False
  526.   ShowError
  527. End Sub
  528. Sub Form_Load()
  529.   Me.Caption = FORMCAPTION
  530.   cmdRefresh.Caption = BUTTON1
  531.   cmdCancel.Caption = BUTTON2
  532.   lblLabels(7).Caption = Label1
  533.   lblLabels(10).Caption = Label2
  534.   lblLabels(8).Caption = LABEL3
  535.   lblLabels(9).Caption = LABEL4
  536.   txtDatabaseName.Text = gDataCtlObj.DatabaseName
  537.   txtConnect.Text = gDataCtlObj.Connect
  538.   chkExclusive.Value = IIf(gDataCtlObj.Exclusive, 1, 0)
  539.   chkDBReadOnly.Value = IIf(gDataCtlObj.ReadOnly, 1, 0)
  540.   txtRecordSource.Text = gDataCtlObj.RecordSource
  541.   optRSType(gDataCtlObj.RecordsetType).Value = True
  542.   If (gDataCtlObj.Options And dbDenyWrite) = dbDenyWrite Then
  543.     chkDenyWrite.Value = vbChecked
  544.   End If
  545.   If (gDataCtlObj.Options And dbDenyRead) = dbDenyRead Then
  546.     chkDenyRead.Value = vbChecked
  547.   End If
  548.   If (gDataCtlObj.Options And dbReadOnly) = dbReadOnly Then
  549.     chkReadOnly.Value = vbChecked
  550.   End If
  551.   If (gDataCtlObj.Options And dbAppendOnly) = dbAppendOnly Then
  552.     chkAppendOnly.Value = vbChecked
  553.   End If
  554.   If (gDataCtlObj.Options And dbInconsistent) = dbInconsistent Then
  555.     chkInconsistent.Value = vbChecked
  556.   End If
  557.   If (gDataCtlObj.Options And dbConsistent) = dbConsistent Then
  558.     chkConsistent.Value = vbChecked
  559.   End If
  560.   If (gDataCtlObj.Options And dbSQLPassThrough) = dbSQLPassThrough Then
  561.     chkSQLPassthrough.Value = vbChecked
  562.   End If
  563.   If (gDataCtlObj.Options And dbFailOnError) = dbFailOnError Then
  564.     chkFailOnError.Value = vbChecked
  565.   End If
  566.   If (gDataCtlObj.Options And dbForwardOnly) = dbForwardOnly Then
  567.     chkForwardOnly.Value = vbChecked
  568.   End If
  569.   optBOFAction(gDataCtlObj.BOFAction).Value = True
  570.   optEOFAction(gDataCtlObj.EOFAction).Value = True
  571.   optOLECtl.Value = IIf(gDataCtlObj.Tag = "OLE", True, False)
  572.   Screen.MousePointer = vbDefault
  573. End Sub
  574.